2042. 检查句子中的数字是否递增 
为保证权益,题目请参考 2042. 检查句子中的数字是否递增(From LeetCode).
解决方案1 
Python 
python
# 2042. 检查句子中的数字是否递增
# https://leetcode-cn.com/problems/check-if-numbers-are-ascending-in-a-sentence/
################################################################################
class Solution:
    def areNumbersAscending(self, s: str) -> bool:
        bfn = -1
        for t in s.split(" "):
            if t.isdigit():
                t = int(t)
                if t > bfn:
                    bfn = t
                else:
                    return False
        return True
################################################################################
if __name__ == "__main__":
    solution = Solution()1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25